package training.controller.kadai.screenVoting;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
/*import org.slim3.controller.validator.Validators;*/
import org.slim3.util.RequestMap;


import training.service.RegistService;

public class VoteController extends Controller {

    private RegistService service = new RegistService();

    @Override
    public Navigation run() throws Exception {

/*理由が未入力の時フォワードさせていたが、
 * 選択肢が変わってしまうため画面で対応
 *         if(!validate()) {
            return forward(basePath);
        }*/
        service.vote(new RequestMap(request));
        return redirect("/kadai/complete/");
    }

/*    protected boolean validate() {
        Validators v = new Validators(request);
        v.add("comment", v.required("理由が入力されていません"));
        return v.validate();
    }*/
}
